1. Field of Application
The present invention relates to an electronic apparatus incorporating microcomputers, in which one of the microcomputers monitors the operation of another one.
2. Description of Related Art
A type of electronic apparatus which incorporates a microcomputer is known, in which a peripheral apparatus of the microcomputer monitors the functioning of the microcomputer, to detect any abnormal operation, as described for example in Japanese patent publication No. 2001-312315. In addition, a type of electronic apparatus which incorporates a plurality of microcomputer is known, in which the functioning of one of the microcomputers is monitored by another microcomputer to detect any abnormal operation. An example of such an electronic apparatus is the image processing apparatus 100 shown in diagram (a) of FIG. 9.
Abnormal operation of a microcomputer may result from one or more of the bits constituting a register in the microcomputer (such as an accumulator or a general-purpose register) become “stuck”, i.e., fixed in the binary 1 or 0 state. This prevents calculation operations from being performed normally. Such a malfunction can be detected as illustrated in diagram (b) of FIG. 9. This is a known method whereby the value C of a variable is transmitted from the monitoring microcomputer to the monitored microcomputer, and the monitored microcomputer uses that value C in executing a test calculation.
To detect any stuck bit(s) in a register of the main microcomputer, the test calculation is predetermined such that different bit patterns will become successively set into the respective registers, and such that each bit of each register will change between the 1 and 0 binary states in the calculations if there are no stuck bits. The final result obtained from the test calculation, designated in the following as the calculation result X, is then added to the variable value C which was sent from the main microcomputer, to obtain a sum value Y (=C+X). The sum value Y is then transmitted from the monitored microcomputer to the monitoring microcomputer. In the following, the monitoring microcomputer will be referred to as the main microcomputer, and the monitored microcomputer as the secondary microcomputer.
To perform such a test calculation, the final result X is always obtained by the same calculation procedure, so that so long as there is no malfunction of any of the registers in the secondary microcomputer, an identical predetermined fixed value will always be obtained for the X. That predetermined fixed value is designated as X0 in the following. However if any of the registers has one or more bits stuck in the 1 or 0 state, the test calculation cannot be executed properly, so that an incorrect value will be obtained as the calculation result X.
If such a malfunction condition exists in a plurality of locations in the secondary microcomputer, then it is possible that X0 may be obtained as the calculation result X, in spite of the abnormal operation. It is for that reason that the variable value C is added to the calculation result X. The operations performed by the secondary microcomputer for obtaining a calculation result X and adding that to a variable value C, to obtain a sum value Y, will be collectively referred to as a “homework calculation” in the following description, i.e., with the sum value Y being the homework calculation result.
Respectively different values of the variable C are successively transmitted from the main microcomputer to the secondary microcomputer. Each time this occurs, the secondary microcomputer performs a homework calculation as described above, using the received value of C, then transmits the homework calculation result Y back to the main microcomputer. The main microcomputer then subtracts the corresponding value of C (i.e., most recently transmitted value of C) from the value obtained for Y. The result of the subtraction is then compared with the correct calculation result value X0.
Hence, the main microcomputer can judge whether or not the main microcomputer is functioning normally, based on whether or not the correct calculation result X0 is obtained from each of a successive predetermined plurality of such subtraction operations.
Types of electronic apparatus are known which incorporate a plurality of microcomputers, in which a main function that is executed by the apparatus is performed by cooperation between the microcomputers, through exchange of data (calculation results, etc.) between them. For example in the field of motor vehicle control, there is a type of driver assistance system known as a lane-keeping assistance (LKA) system which can control a vehicle to follow a specific traffic lane that is defined on a road. Such a system may be of the basic form illustrated in diagram (a) of FIG. 9, which incorporates the plurality of microcomputers microcomputer 101 and 103. The microcomputer 101 acquires image data from a digital video camera 105, and performs processing such as edge detection processing on the image data. The microcomputer 103 operates on detection results obtained by the microcomputer 101, to perform processing for recognition of lane markers (e.g., white lines on the road surface), etc. The image processing apparatus 100 thereby derives road parameters for the road along which the vehicle is currently travelling, i.e., parameters expressing the form of the road, etc.
In the image processing apparatus 100, the edge detection results obtained from the image processing apparatus 10 (which is connected to the camera 105), i.e., information indicating detected edge positions, are transmitted to the microcomputer 103. The microcomputer 103 thereby derives road parameters, and transmits these to the microcomputer 101. The road parameters are transmitted from the microcomputer 101 to a ECU 110, which is externally connected to the microcomputer 101, and the ECU 110 uses the obtained road parameters in performing control of the vehicle.
When the image processing apparatus 100 is configured such that the procedure described above is used for monitoring the operation of the microcomputer 103, then together with periodically performing processing for executing the main function of the microcomputer 101, the microcomputer 101 also periodically transmits successive values of the variable C to the 103. After the microcomputer 103 performs a homework calculation, it is necessary for the corresponding homework calculation result Y to be received by the microcomputer 101.
However if the data communication that is performed relating to the main function and the data communication for monitoring the operation of the microcomputer 103 are executed respectively independently, then complex processing is required for controlling the communication between the microcomputer 101 and the microcomputer 103, so that it is difficult to achieve stable control of the operation of the apparatus.
As has been previously envisaged by the assignees of the present invention, it would be possible to execute data communication between the microcomputer 101 and microcomputer 103 for monitoring the operation of the microcomputer 103 concurrently with data communication relating to the main function. If the image processing apparatus could be configured to perform such concurrent data communication, then processing relating to such communication could be simplified and stable operation of the apparatus could be ensured. For example, if such a method were to be applied for monitoring the operation of the microcomputer 103, the processing executed by the microcomputer 101 and the microcomputer 103 might be as shown in the timing diagram example of FIG. 10.
In this case, the microcomputer 101 acquires data constituting a specific number of lines of image data (horizontal scan lines of a video signal frame) in each of successive intervals that are synchronized with the vertical synchronizing signal of the video signal from the camera 105, with the acquired amount of image data as being predetermined as the amount required for processing to detect white lines (i.e., lane markers) formed on a road surface. The microcomputer 101 performs edge detection processing on each set of image data thus acquired. The information constituting the edge detection results is then transmitted by the microcomputer 101 to the microcomputer 103. Concurrent with this transmission of edge detection results, a count value N which is updated each time a new set of image data are acquired (with N being obtained from a counter which performs up-counting) is transmitted from the microcomputer 101 to the microcomputer 103, to constitute the variable value C, which is required for the homework calculation as described above.
The microcomputer 103 uses the inputted edge information to perform white-line recognition processing, i.e., calculation processing for obtaining road parameters. Before or after this is done, the microcomputer 103 performs a homework calculation using the variable value C most recently transmitted from the microcomputer 101. When the homework calculation result (sum value Y) and road parameters have been derived, the microcomputer 103 transmits these concurrently (i.e., in immediate succession) to the microcomputer 101.
As well as performing image data acquisition and edge detection operations, the microcomputer 101 performs judgement processing for detecting abnormal operation of the microcomputer 103, based on the received sum values Y. The most recently attained count value N is subtracted from the currently received sum value Y, to obtain a subtraction result Z, and a decision is then made as to whether or not the subtraction result Z is correct.
With this example, the variable value C is updated (i.e., counter N is incremented) each time the current value of C has been transmitted to the microcomputer 103. Hence as can be understood from the timing diagram of FIG. 10, each time the microcomputer 101 processes a homework calculation result Y which has been transmitted from the microcomputer 103, the current value of C will already have been incremented by 2 relative to the value of C which was used in executing that homework calculation. That is to say, in performing the abnormality judgement, the microcomputer 101 operates on a homework calculation result (sum value Y) which is based on a variable value C that was transmitted from the microcomputer 101 to the microcomputer 103 two cycles previously. Thus if the microcomputer 103 is operating normally, the subtraction value Z that is obtained by subtracting the current count value N (i.e., current value of C) from the most recently received homework calculation result Y will be equal to (X0−2), where X0 is the correct value of Y.
Thus, to perform the abnormality judgement, the microcomputer 101 judges whether the subtraction value Z is equal to the correct value (X0−2), each time a new homework calculation result Y is received from the microcomputer 103. If it is found that an incorrect result is obtained for Z a predetermined plurality of times in succession, then the microcomputer 101 transmits diagnostics information indicative of abnormality of the microcomputer 103, to the external ECU 110. Otherwise, the microcomputer 101 transmits diagnostics information indicating that the microcomputer 103 is functioning normally, to the ECU 110.
However with such a method, the following problem arises. The transmissions of the variable value C to the microcomputer 103 are synchronized with the processing operations of the microcomputer 101, i.e., occur at the start of each frame period of the video signal. However the transmissions of the homework calculation result Y together with road parameters, from the microcomputer 103 to the microcomputer 101, cannot be so synchronized. If the microcomputer 103 requires a substantial amount of time to perform white-line recognition processing, it may not be possible for the currently obtained homework calculation result Y (i.e., calculated using a specific value of C) to be transmitted to the microcomputer 101 during the same cycle in which that value of C was transmitted from the microcomputer 101. (where the term “cycles”, with this example, refers to the intervals between successive vertical synchronizing signal of the camera). This will prevent the microcomputer 101 from performing abnormality judgement correctly.
The reasons for this can be readily understood by referring to the timing diagram example of FIG. 11.
With the image processing apparatus 100 of FIG. 9, the microcomputer 101 performs processing for receiving the road parameters and the homework calculation result Y in parallel with executing its main function. That is to say, in parallel with executing the operations constituting its main function, each time that data are transmitted from the microcomputer 103, the microcomputer 101 writes the received road parameters and homework calculation result Y (received via a serial interface) into a receiving buffer. This is a region reserved in an internal RAM of the microcomputer 101. Thereafter, immediately before the next transmission of edge detection information to the microcomputer 103, the ECU 110 transfers the data that had been most recently written into the receiving buffer into a separate region in RAM, i.e., a working memory region. The homework calculation result Y and is then used by the microcomputer 101 to judge whether the microcomputer 103 is operating normally, and the road parameters are transmitted to the ECU 110.
Hence with such a type of image processing apparatus 100, if the microcomputer 101 has not received updated homework calculation result and road parameter data from the microcomputer 103 during the preceding cycle (preceding frame period), but receives them during the current cycle (as illustrated for the third frame period in FIG. 11, when the counter N is 14), the homework calculation result Y from two cycles previously will be read out from the receiving buffer and utilized in the abnormality judgement.
Since the current value of N is not applicable to that homework calculation result, it will be judged (incorrectly) that abnormal operation of the 103x is occurring.
That is to say, the value which is subtracted from the homework calculation result Y will have been increased from the correct value by 1, so that even if the microcomputer 103 is operating normally, the subtraction result Z will be obtained as (X0−3) and hence will not match the correct subtraction result of (X0−2).
Furthermore, (referring again to the third period in FIG. 11, when the value of N is 14), in such a case, after the delayed homework calculation result Y and road parameters have been written into the receiving buffer of the microcomputer 101, that value of Y will then be used in the abnormality judgement operation in the succeeding cycle (when N is 15). That abnormality judgement will use an inappropriate count value C (i.e., 15). Thus in such a case too, due to the effects of the delay in transmitting the data from the microcomputer 103, the microcomputer 101 will again find that the subtraction result Z does not match the correct value of (X0−2), and so will incorrectly judge that the microcomputer 103 is functioning abnormally, even if it is actually operating normally.
This condition of incorrect abnormality judgement will continue so long as the transmission delay condition of the microcomputer 103 continues, as illustrated in FIG. 11.
It can thus be understood that with such a method, in which a count value N is transmitted as the variable value C from the microcomputer 101 to the microcomputer 103, and the microcomputer 103 derives the homework calculation result Y based on that count value N, if there is a delay in the processing executed by the microcomputer 103 to the extent that a homework calculation result Y cannot be transmitted by the microcomputer 103 to the microcomputer 101 within the appropriate cycle, then the microcomputer 101 will use an incorrect count value when performing the abnormality judgement. The subtraction result Z thus will not match the correct value of (X0−2), and when this condition occurs more than a predetermined plurality of times in succession, the microcomputer 101 will (incorrectly) judge that the microcomputer 103 is not functioning normally, and will send diagnostics information indicative of this incorrect judgement to the ECU 110.
Thus, even if the microcomputer 101 is configured to judge that abnormal operation of the microcomputer 103 is occurring only under the condition that an incorrect value for the subtraction result Z is obtained a specific number of times in succession, this condition may arise even if the microcomputer 103 is functioning normally. This is due to the fact that when the microcomputer 103 is performing processing such as white line recognition processing, and this causes a delay in transmitting a homework calculation result Y to the microcomputer 101, such a delay may occur for each of a plurality of successively obtained values of Y. Hence in such a case, the microcomputer 101 will incorrectly diagnose that the microcomputer 103 is not operating normally.
If the microcomputer 101 were configured to manage the information that determines the variable value C which will be used in each abnormality judgement, such as to ensure that the appropriate value of C will be applied in executing each abnormality judgement, such a problem could be avoided.
However in such a case it would be necessary for the main microcomputer to detect any delay in transmission by the secondary microcomputer, and to take account of the transmission delay in determining the appropriate corresponding variable value C to be used in performing an abnormality judgement. This will involve complex processing.
Furthermore in addition to the transmission delays, another problem exists, in that the secondary microcomputer may sometimes fail to receive a variable value C that is transmitted from the main microcomputer. For example if the secondary microcomputer is busy in performing processing relating to its main function when a variable value C is transmitted from the main microcomputer, then the secondary microcomputer will not receive that updated value of C, and so will not use it when performing the next homework calculation processing. This “reception failure” condition is illustrated in the second and fourth cycles in the example of FIG. 11. It would be necessary for the main microcomputer to recognize when such a reception failure occurs, in order to use the appropriate values of the variable C in judging the homework calculation results. Otherwise, reliable judgement as to abnormal operation of the secondary microcomputer would not be possible.